package com.haizhi.crm.biz.task.message.engine;

import com.haizhi.crm.biz.task.message.handler.AbstractHandler;
import com.haizhi.crm.biz.task.message.handler.HandlerBuilder;
import com.haizhi.crm.biz.task.message.handler.MsgResponse;
import com.haizhi.crm.biz.task.message.handler.PushHandler;
import com.haizhi.crm.biz.task.message.model.ContextDto;
import org.springframework.stereotype.Component;

/**
 * Created by wangshan on 2018/6/8.
 */
@Component
public class MessageActualPush {

    private AbstractHandler abstractHandler = HandlerBuilder.build()
            .add(PushHandler.class)
            .get();

    public boolean push(ContextDto contextDto) {
        MsgResponse response = abstractHandler.processData(contextDto);
        return response.isSucess();
    }

}
